class_name PoisonDamageEffect
extends Effect

var amount := 0
var targets: Array[Node] = []

func execute(targets: Array[Node]) -> void:
	var final_targets = targets if targets.size() > 0 else self.targets
	
	for target in final_targets:
		if not target or not is_instance_valid(target):
			continue
		if target is Enemy:
			print("☠️ 毒伤触发: %s 受到 %d 点毒伤" % [target.name, amount])
			target.take_damage(amount, Modifier.Type.DMG_TAKEN)
			
			if sound:
				SFXPlayer.play(sound)
		else:
			print("❌ 目标不是Enemy类型: %s" % target.get_class()) 
